package com.ujiuye.response;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/r4")
public class ResponseDemo3 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //有中文解决乱码
        resp.setContentType("text/html;charset=utf-8");
        resp.getWriter().print(97);//97
        resp.getWriter().write(97);//a
    }
}
